let mysql = require("mysql");
let connection = mysql.createConnection({ host: "127.0.0.1", user: "root", password: "root", port: "3306", database: "user" });
connection.connect();


let bt=new Date();

let insertsql = "INSERT into user (`name`,`age`,`sex`,`birthtime`,`updatatime`) values ('arashi','20','男','" + bt + "','" +bt + "')";
connection.query(insertsql, (err, data) => {
    console.log(err);
    console.log(data);
})

let sql = "select * from user limit 1,1";
connection.query(sql, (err, data) => {
    console.log(err);
    console.log(data);
    console.log(data[0].name);
    console.log(data[0].age);
})

let updatesql = "update user set name='D4Cl', updatatime='" + bt + "' where name='D4C' ";
    
connection.query(updatesql, (err, data) => {
    console.log(err);
    console.log(data);
});



let deletesql="delete from user where name='jojo'";
connection.query(deletesql, (err, data) => {
    console.log(err);
    console.log(data);
});

connection.end()